<template>
  <div style=" padding: 15px;">
    <div>
      <div style="margin-top: 15px;margin-bottom: 15px;display: flex;justify-content: center">
        <div  style="flex: 1">
          <el-input placeholder="请输入车牌号" v-model="s" class="input-with-select" style="width: 200px"> </el-input>
          <el-button type="primary" icon="el-icon-search" >查询</el-button>
        </div>
        <div>
          <el-button type="primary" icon="el-icon-plus" @click="$router.push({ path: '/information/carEdit'})" >添加</el-button>
        </div>
      </div>
    </div>
    <UTable ref="mTable" :search-api="getCarByPage" :columns="columns" />

  </div>

</template>
<script>
import UTable from '@/components/UTable'
import {getCarByPage} from '@/api/car'
export default {
  components: {
    UTable
  },
  data() {
    return {

      getCarByPage:getCarByPage,
      columns: [
        { prop: 'id', label: '车辆编号' },
        { prop: 'deviceNumber', label: '设备号',width:100 },
        { prop: 'brandName', label: '车辆品牌',width:'100px' },
        { prop: 'model', label: '车型',width:'100px' },
        { prop: 'plateNumber', label: '车牌号',width:'150px' },
        { prop: 'temperature', label: '温度',width:150,formatter:function (row){
                return row.temperature01+'-'+row.temperature02
          } },
        {prop:'humidity',label:'湿度',width:100},
        { prop: 'xinghaoqiangdu', label: '信号强度',width:150 },
        { prop: 'power', label: '电量',width:150 },
        { prop: 'status', label: '状态',width:'100px', filters:[{ text: '启用', value: '1' },{ text: '禁用', value: '0' }] },
        { prop: 'createtime', label: '创建时间',width:150 },
        { type: 'handle', fixed: 'right', buttons: [
          { text: '编辑', type: 'ifno' },
          { text: '定位', type: 'ifno' },
          { text: '启用', type: 'danger', isShow: function(row, rowIndex) { return row.status === 0 } },
          { text: '禁用', type: 'danger', isShow: function(row, rowIndex) { return row.status === 0 } }
        ]
        }
      ]
    }
  }
}
</script>

<style scoped>

</style>
